home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / SNNSV32.ZIP / SNNSv3.2 / kernel / sources / func_mac.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-04-25  |  2.5 KB  |  86 lines

  1. /*****************************************************************************
  2.   FILE           : func_mac.h
  3.   SHORTNAME      : 
  4.   SNNS VERSION   : 3.2
  5.  
  6.   PURPOSE        : SNNS-Kernel: Macros for transfer functions
  7.   NOTES          :
  8.  
  9.   AUTHOR         : Niels Mache
  10.   DATE           : 21.06.90
  11.  
  12.   CHANGED BY     : Sven Doering
  13.   IDENTIFICATION : @(#)func_mac.h    1.10 3/15/94
  14.   SCCS VERSION   : 1.10
  15.   LAST CHANGE    : 3/15/94
  16.  
  17.              Copyright (c) 1990-1994  SNNS Group, IPVR, Univ. Stuttgart, FRG
  18.  
  19. ******************************************************************************/
  20. #ifndef KR_FUNC_MACROS
  21. #define KR_FUNC_MACROS
  22.  
  23. #define  UNIT_PTR   struct Unit *
  24. #define  SITE_PTR   struct Site *
  25.  
  26. #define  ACT_FUNC_DEFS      register struct Link  *__link_ptr; \
  27.                             register struct Site  *__site_ptr;
  28.  
  29. #define  SITE_FUNC_DEFS     register struct Link  *__link_ptr;
  30.  
  31.  
  32. /*#################################################
  33.  
  34. GROUP: Link Macros
  35.  
  36. #################################################*/
  37.  
  38. #define  GET_FIRST_UNIT_LINK( u_ptr )   (__link_ptr = ( (u_ptr)->flags & UFLAG_DLINKS) ? \
  39.                                          ( (struct Link *) (u_ptr)->sites) : (NULL) )
  40.  
  41. #define  GET_FIRST_SITE_LINK( s_ptr )   (__link_ptr = (s_ptr)->links)
  42.  
  43. #define  GET_NEXT_LINK      (__link_ptr = __link_ptr->next)
  44.  
  45. #define  GET_WEIGHTED_OUTPUT    ( (__link_ptr->weight) * (__link_ptr->to->Out.output) )
  46.  
  47. #define  GET_OUTPUT         (__link_ptr->to->Out.output)
  48.  
  49. #define  GET_WEIGHT         (__link_ptr->weight)
  50.  
  51. /* calculate each component of the euclidic distance */ 
  52. #define  GET_EUCLID_COMP    ( ((__link_ptr->weight) - (__link_ptr->to->Out.output))*((__link_ptr->weight) - (__link_ptr->to->Out.output)) )
  53.  
  54.  
  55. /*#################################################
  56.  
  57. GROUP: Site Macros
  58.  
  59. #################################################*/
  60.  
  61. #define  GET_FIRST_SITE( u_ptr )    (__site_ptr = ( (u_ptr)->flags & UFLAG_SITES) ? \
  62.                                      ( (u_ptr)->sites ) : (NULL) )
  63.  
  64. #define  GET_NEXT_SITE      (__site_ptr = __site_ptr->next)
  65.  
  66. #define  GET_SITE_NAME      (__site_ptr->site_table->Entry.site_name->Entry.symbol)
  67.  
  68. #define  GET_SITE_VALUE     ( (*__site_ptr->site_table->site_func) (__site_ptr) )
  69.  
  70. /*  Future Application (in SNNS-Kernel V1.4 the sites don't have weights).
  71. */
  72. #define  GET_SITE_WEIGHT    ((FlintType) 1)
  73.  
  74.  
  75. /*#################################################
  76.  
  77. GROUP: Unit Macros
  78.  
  79. #################################################*/
  80.  
  81. #define  GET_UNIT_BIAS( u_ptr )  ((u_ptr)->bias)
  82. #define  GET_UNIT_ACT( u_ptr )   ((u_ptr)->act)
  83.  
  84.  
  85. #endif
  86.